import React, { useState, memo, useContext, createContext } from 'react'

// function Son(props) {
//     console.log('1111')
//     return (
//         <h3>我是儿子组件-</h3>
//     )
// }
// const Son = (props) => {
//     return (
//         <h3>我是儿子组件-</h3>
//     )
// }

const Son =memo(() => {
    console.log('1111')
    return (
        <h3>我是儿子组件-</h3>
    )
}
)


export default function Context00(props) {
    let [msg, setMsg] = useState(0)
    const add = (params) => {
        setMsg(msg+1)
    }
    
    return (
        <div>
            <button onClick={add}> 点击添加{msg} </button>
             <Son></Son>
        </div>
    )
}

